import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86185
 * Date: 2023-10-10
 * Time: 16:01
 */

public class Exam1010 {
    static int ans = 0;
    public static void f(int a, int b) {
        if(a % b == 0) {
            ans = b;
        } else {
            f(b, a% b);
        }
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        f(a, b);
        System.out.println(a * b / ans);
    }
    public static boolean isLengths(String[] strings) {
        for (int i = 0; i < strings.length - 1; i++) {
            if(strings[i].length() > strings[i + 1].length()) {
                return false;
            }
        }
        return true;
    }
    public static boolean isLengths2(String[] strings) {
        for (int i = 0; i < strings.length - 1; i++) {
            if(strings[i].length() < strings[i + 1].length()) {
                return false;
            }
        }
        return true;
    }
    public static boolean compare(String s1, String s2) {
        int i = 0;
        for (; i < s1.length() && i < s2.length(); i++) {
            char c1 = s1.charAt(i);
            char c2 = s2.charAt(i);
            if(c1 > c2) {
                return false;
            }
        }
        if(s1.charAt(i - 1) < s2.charAt(i - 1)) {
            return true;
        }
        if(i == s1.length() && i == s2.length() || i == s1.length() && i < s2.length()) {
            return true;
        }
        return false;
    }
    public static boolean compare2(String s1, String s2) {
        int i = 0;
        for (; i < s1.length() && i < s2.length(); i++) {
            char c1 = s1.charAt(i);
            char c2 = s2.charAt(i);
            if(c1 < c2) {
                return false;
            }
        }
        if(s1.charAt(i - 1) > s2.charAt(i - 1)) {
            return true;
        }
        if(i == s1.length() && i == s2.length() || i == s2.length() && i < s1.length()) {
            return true;
        }
        return false;
    }
    public static boolean isLexicographically2(String[] strings) {
        for (int i = 0; i < strings.length - 1; i++) {
            if(!compare2(strings[i], strings[i + 1])) {
                return false;
            }
        }
        return true;
    }
    public static boolean isLexicographically(String[] strings) {
        for (int i = 0; i < strings.length - 1; i++) {
            if(!compare(strings[i], strings[i + 1])) {
                return false;
            }
        }
        return true;
    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        String[] strings = new String[n];
        scanner.nextLine();
        for (int i = 0; i < n; i++) {
            strings[i] = scanner.nextLine();
        }
        boolean flag1 = isLengths(strings);
        boolean flag2 = isLexicographically(strings);
        boolean flag3 = isLengths2(strings);
        boolean flag4 = isLexicographically2(strings);
        if(flag1 && flag2 || flag3 && flag4 || flag1 && flag4 || flag2 && flag3) {
            System.out.println("both");
        } else if (flag1 || flag3) {
            System.out.println("lengths");
        } else if(flag2 || flag4){
            System.out.println("lexicographically");
        } else {
            System.out.println("none");
        }
    }
    public static void main1(String[] args) {
        int n = 0;
        B b = new B();
        n = b.getValue();
        System.out.println(n);
    }




    static class A {
        protected int value;
        public A(int v) {
            setValue(v);
        }
        public void setValue(int value) {
            this.value = value;
        }
        public int getValue() {
            try {
                value++;//6
                return value;
            } catch (Exception e) {
                System.out.println(e.toString());
            } finally {
                this.setValue(value);
                System.out.println(value);//6
            }
            return value;
        }
    }
    static class B extends A {
        public B() {
            super(5);
            setValue(getValue() - 3);
        }
        public void setValue(int value) {
            super.setValue(2 * value);
        }
    }
}
